package com.li.flink.utils

import java.sql.{Connection, DriverManager}

object MysqlUtils {
  val password = "123456"
  val user = "root"
  val url = "jdbc:mysql://localhost:3306/flink_demo"

  def closeConnetion(conn: Connection) = {
    if (conn != null) {
      conn.close()
    }
  }

  def main(args: Array[String]): Unit = {
    print(MysqlUtils.getConnection())
  }

  def getConnection(): Connection = {
    val connetcion = DriverManager.getConnection(url, user, password)
    connetcion
  }
}
